/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.csvgenerator.engine.vg;

import com.csvgenerator.settings.GlobalConstants.BlankSpace;
import com.csvgenerator.settings.GlobalConstants.NewLine;

/**
 *
 * @author Administrator
 */
public class FixedTextValueGenerator extends ValueGenerator {

    private String fixedText = "";
    private BlankSpace blankSpace = BlankSpace.NONE;
    private NewLine newLine = NewLine.NONE;

    public FixedTextValueGenerator() {
    }

    @Override
    public String nextValue() {
        String nextValue = fixedText;
        switch (blankSpace) {
            case BEFORE:
                nextValue = " " + nextValue;
                break;
            case AFTER:
                nextValue = nextValue + " ";
                break;
            case BOTH:
                nextValue = " " + nextValue + " ";
                break;
            case NONE:
            default:
        }
        
        switch (newLine) {
            case BEFORE:
                nextValue = "\n" + nextValue;
                break;
            case AFTER:
                nextValue = nextValue + "\n";
                break;
            case BOTH:
                nextValue = "\n" + nextValue + "\n";
                break;
            case NONE:
            default:
        }
        currentValue = nextValue;
        return nextValue;
    }

    public String getFixedText() {
        return fixedText;
    }

    public void setFixedText(String fixedText) {
        this.fixedText = fixedText;
    }

    /**
     * @return the blankSpace
     */
    public BlankSpace getBlankSpace() {
        return blankSpace;
    }

    /**
     * @param blankSpace the blankSpace to set
     */
    public void setBlankSpace(BlankSpace blankSpace) {
        this.blankSpace = blankSpace;
    }

    /**
     * @return the newLine
     */
    public NewLine getNewLine() {
        return newLine;
    }

    /**
     * @param newLine the newLine to set
     */
    public void setNewLine(NewLine newLine) {
        this.newLine = newLine;
    }
}
